package com.kgc.skProvider.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.collection.remote.WriteOffRemote;
import com.kgc.skProvider.service.WriteOffService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.Map;

@Controller
public class WriteOffController  implements WriteOffRemote {

    private Logger logger = LoggerFactory.getLogger(WriteOffController.class);

    @Autowired
    private WriteOffService writeOffService;

    @Override
    public ResponseMsg selectWriteOffType() {
        logger.info("WriteOffController WriteOffController are start");
        ResponseMsg responseMsg = writeOffService.selectWriteOffType();
        logger.debug("WriteOffController WriteOffController are end return {}", responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg selectWriteOffByPage(Map<String, Object> map) {
        logger.info("WriteOffController WriteOffController params {}", map.toString());
        ResponseMsg responseMsg = writeOffService.selectWriteOffByPage(map);
        logger.debug("WriteOffController WriteOffController params {}", responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg insertWriteOff(Map<String, Object> map) {
        logger.info("WriteOffController insertWriteOff params {}", map.toString());
        ResponseMsg responseMsg = writeOffService.insertWriteOff(map);
        logger.debug("WriteOffController insertWriteOff params {}", responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg updateWriteOff(Map<String, Object> map) {
        logger.info("WriteOffController updateWriteOff params {}", map.toString());
        ResponseMsg responseMsg = writeOffService.updateWriteOff(map);
        logger.debug("WriteOffController updateWriteOff params {}", responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg deleteWriteOff(Map<String, Object> map) {
        logger.info("WriteOffController deleteWriteOff params {}", map.toString());
        ResponseMsg responseMsg = writeOffService.deleteWriteOff(map);
        logger.debug("WriteOffController deleteWriteOff params {}", responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg checkWriteOff(Map<String, Object> map) {
        logger.info("WriteOffController checkWriteOff params {}", map.toString());
        ResponseMsg responseMsg = writeOffService.checkWriteOff(map);
        logger.debug("WriteOffController checkWriteOff params {}", responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg selectWriteOffByCode(Map<String, Object> map) {
        logger.info("WriteOffController selectWriteOffByCode params {}", map.toString());
        ResponseMsg responseMsg = writeOffService.selectWriteOffByCode(map);
        logger.debug("WriteOffController selectWriteOffByCode params {}", responseMsg);
        return responseMsg;
    }
}
